﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace H01
{
    class Program
    {
        static void Main(string[] args)
        {
            double n = 1.0, sum = 1.0;
            //while结构
            while (n <= 99)
            {
                sum = sum + n / (n + 1);
                n++;
            }

            //do...while结构
            //do
            //{
            //    sum = sum + n / (n + 1);
            //    n++;
            //}
            //while (n <= 99);

            //for (; n <= 99; n++)
            //{
            //    sum = sum + n / (n + 1);
            //}
            Console.WriteLine("结果为 {0}",sum);
            Console.ReadKey();
        }
    }
}
